/* eslint-disable import/no-extraneous-dependencies */
import axios from 'axios';

axios.defaults.baseURL = 'http://interview-api-t.itheima.net/';

// 添加请求拦截器
axios.interceptors.request.use(
  (config) => config,
  (error) => Promise.reject(error),
);

// 添加响应拦截器
axios.interceptors.response.use(
  (response) => {
    console.log(response);
    return response.data.data;
  },
  (error) => Promise.reject(error),
);

export default axios;
